Slighly changed the implementation of getPointer to adjust for the new argument