The majority of the work was done by David Carlier, with input from myself and semarie@. OK semarie@, thanks!