Remove dependency on NumPy