Implemented removeFromHead() and removeFromTail()