fix to cursor initialisation, new match algorithm, new reference phase method not great, perhaps more