Adding in DB query code