Worked on functions for the GUI