> Thanks, looks like a good start. Attached find a slightly simpler and hopefully more correct version. martin