insert nodes in the right location
tidy up