fixed spelling mistake (exist) lower cased all conditions (if,else)
removed tree as it is redundant with files-by-date