typo fixed, imports reorganized, javadoc added for clarification