P1 and P2 added
Javadoc added