More generic pxd. Added tests for more functions.