cleaning up the lottery implementation