flow.js improvements

added some more variables and made sure the code is jslint complient