undid the head and tail stuff