Adding random gen method