updated code to incorporate changes using d7 schema query builder API as a test - debugging