updating tree nodes positions