Add JavaDoc, minor modifications