tightened up code for roll/unroll operations