FInal version of IFELSE TO