commiting my own and seege@ code for habr article