Haven't got any repsonses, but for me it seems to work fine. Maybe I haven't tested some use-case though. I have tied-up just a bit: removed unnecessary commented out line I added while testing and unnecessary argument passing to pre-processing routines. If it is still interesting. I attach also my working file if someone wishes to just eval and test it without rebuilding.