my own implementation
code before tutorial
somewhat working code, without ready channel