Added some GUI, refactored a lot.