switched not numeric to numeric in is numeric function, modified cascading logic