the function arange(1, L) is replaced with range(L) that is faster