Completed if logical exercise