working! checks with raf's old matlab code on a number of examples.