memory init and a little pointer trick