Completed If logical exercise