Core

Core implementation

fixes #16