final edits + habr version