fix datatype for y when it can't be negative