removed debug code
added portal events and added configuration options for portals