finished push_to_head and push_to_tail.