added debug output and added pygame.QUIT as allowed events