implemented map nodes, slight refactoring