bug- can't pass y when it's a factor-- now throws error