Simply query generation and make it work.