cleaned up the code. no graphical changes