position_nodes function

Creates smart node layout.