removed some of the debug code, the c implemenation should be more robust to the type of numpy arrays given