Restored roll function

I accidentally scrubbed the most important part of this module
while I was scrubbing the old list comprehension code.