gui working

Fixed a lot of problems from the previous code test and also the code
for the working gui