converted fpolys.js to LiveScript