added dir separator to each path end, updated usages, and removed mod function