Dear Tony, main code to be called from command line. Fixed a type error -Ben