Continued UI implementation. Fixed some bugs.