Updated UI code, added a bunch of comments and restructed some of the objects.