Changed endPos's Type From Bool To Int