Merging in GUI

seems like GUI code was refactored, few minor issues here and there, but overall is good. merging!