Very rough outline, may look some more at it on sunday. Will try and
build whole program with client as to be able to test.