Added rand_int method.