Refactor. Added Predecessor and Successor functionality