Map reads to reference

Fixes #599