finished rewrite and testing of GUI