Finally solved ch9, ex6. Enclose in full if/else.