generating a valid solution