Created gui and added logic to most of the controls