changed head and next to old_head and new_head