Applied patch from ability function to main function.

Incidentally, this also fixes the "double gender" prompting. Another
reason why cin >> is unreliable.