in reply to populate a hash, with limits set by user?
What do you mean "enter in variables from the user"? How does the user set the limit? Why does this look so much like a homework assignment?