cleaning up gui and adding functionality