v2.0 move previous main code as script to print to stdout