Lotory Functions

and some small issue