Setup of program Times
Some minor refactoring and Bug correcting