added support for returning clause
a bit of work