Updated gui and code reformat