Added features to "calcTime" function.