cleaning up code and making final changes