correction to the V1 code -- kn[] array ought to be uint not int