Added basic query code