first try at this
another try at this
add validation before query generation