moved loops around, not really faster
reworked unrolling