modified all SQL calls to be compliant with new Schema