made read function a macro