avoid extra layers by removing nodes while updating their position