changed coffee script to js