fix bugs, add GUI, working version