Is the boundscheck actually necessary, since this can speedup the computation a lot?