adding paths and writing txt file