re #138 - built basic functionality. Ready to refactor, after that some testing