implement a function rolling left to right.