Re-implement loop unroll