replacing memory by simple pointer