Implemented two pass behaviour, no need for instance map any more, see #8