reverse linked list implementation and testing