A smarter way to play the lottery