Replace ...if to if...then...