change to_ptr and to_mut_ptr to as_ptr and as_mut_ptr