On an algorithm for constructing uniformly distributed Korobov grids