cleaned up code and tested successfully