Moved main method in GUI to Main and passed the database object to the gui. Also added comments