Added more JavaDocs + small code edits