endNode => endLoc, print statements added