convert coffee to js. oops