rough and ready if/else to deal with multiple nodes. Need to work out how to use maps...