fixed some bugs. output of gui still looks funky.