added version with only inner loop in asm.js