Rewrote changeNode for better performance