Add solution from JavaScriptOne