added javadocs

+ various exception trows added