updated delete_first_node function