first example. 
moved range function to utils.
bunch of cleanup.