Finished GUI and most of logic