generating portals

see issue #9