new sql syntax building model is working (though, very hackish!)