add timetomax condition
Merge pull request #19 from rootlsuer/master

add timetomax condition