cleaned up code and removed extraneous pieces