rename tail -> getLastKey, head -> getFirstKey