array index bugfix
main routine
added -set timeformat command