Added path handling
Added file mapping function