Finished removeNode function