improved reference mapping