Temporary commit with working implementation.

Will be refactored then.
todo: add logger