Moved code into isLadder helper function.