Rewrite of core
Merge pull request #2 from jolt/may23-rewrite

Rewrite of core