new constructor and javadoc added