Added GUI, fixed some bugs