Added in some functionality to identify files outside of folders and
refactored some other things