ocra generation, seems to contain a bug