implement basic lottery functions