random method implemented