clean up

cleaned up the code a bit, and added some user interface for some
problems