added javadocs and toString()