refactored calcWalkwayAdj function to use a helper function