Database queries are less expensive; score/win condition added