Implemented circular linked-list, but not working properly.