made minor change to path selection algorithm implementation to make future changes (pending) easier