backend entirely rewritten
Merge branch 'new_backend' into backend_rewriting