first working version compiling to JS