Implementation of new Ref.prev and Ref.next methods