Renamed _getParentStates -> _getAncestorStates. Added a brief comment to help understand the function quickly.