Updated the interpolatory weights function and added a unittest.