updated w/JavaDocs and simplified code per @joesondow's code review