Add a numpy implementation, and test for higher n for performance