I know you didn't add this, but might be good to clean $cate up to $cat at some point. "cate" is kind of a weird way to abbreviate "category"