added numba support to increase speed