change to use stdlib functions is_string() and is_array() insted of
type() which is now a reserved word