now it saves the path in variables so that they can be read
refactored the code