Lotto: tests and clean code