javadocs added, reformatting of code and code narc fixes