move randMax to patches file