Added a GUI, and minor changes and bugfixes