Major update. Rewriting the core