Adding code which reverses linked list part by part.