Code working for pointer reads