Proper addToTail implementation