added weight to SQL query