This is as far as I got so far today; have to switch to some other urgent work for the moment, but will resume later.