making pfactor a js file