adapted to new pointer api