fixed weird GUI bug, added comments