tests for head and tail