implementing different machine learning/artificial intelligence algorithms in coffeescript