implemented rand int function