Implemented the Lottery class.