cleaned up code and deleted some methods