final versions of my code