Changed random method