some fun code from learn.js.ru