refactored the mapNode creation bit, making it a little more functional and a little less imperative.