allow execution from command line.

Add code at start of program and chang execution access.