Pure JS
Pure JS version 1