built most of gui
bug fix