Added nextId and prevId to solve open and closed interval issues. Did not solve anything