moved logic to coffee script file, added windows support