add nogil and other speedups