Add comment explaining algorithm
Fix complexity mistake

Oops, I really thought this was a fix that I'd already done before the pull request earlier.
Merge pull request #2 from cayennes/explanation

Add comment explaining algorithm