Fixed some errors and added gui