Fixed some bugs and got GUI sorta working