stable version with all tests.
without assert and sql queries