fixed randim-n