code with unrolled for loops.