added comments for gui code