Added unit tests for p2