This is really well written.  If you use a different variable name besides compliment, your code would be more intuitive, since the variable is not the complement until the very end.