random generator and rules done