added some comments for KR. Started to fix the issue with random number generation