Fixed bugs + finalized the gui