Update shMaps to correct a mistake
Compute B matrix outside of the loop