version 2 with if else