Converted getPoints() to use two SQL statements instead of calling an
SQL query for each row. Much more efficient and correct.