Cleaned up code and user interface quite a bit.