fix bugs, create test files and include pnp library