Compute B outside of the loop + add timer