cleaning up taketime code and adding the option of input by directory