speedup by unrolling loops