cleaned up all the code