converted code from coffee to js in preperation for use harmony features