adding type and updating queries

Per issues #169 and #157