ptr keeps track of the location of the root entry as it shifts down

int ptr,succ;