modified the way we are building the path