page and delete logics with some bugs