commit with separate module for running the programs

2nd Commit with comments and separate main module