changed np to npoints to avoid clash with numpy