Changing these to functions provides a substantial speedup since read-oam is called so much.