added JavaDoc for head methods
added tests for head