adding PS library and test cases
fix jshint issues