Revese the linked list and cleanups