I was simply thinking about switching the two statements:

    } elseif ($page == 1 && count($results) < $limit) {