cleaned up code and updated start script