nodes in arrary
refactor as library