Removed unnecessary variable - 'endpath'