Further work on if_logical exercise