I prefer the using PHP's "count" to count the results. I will push the updated code soon.