Please make sure to follow the [code style](https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide) throughout, e.g. there are some problems here:
- Comments written in a non-Javadoc like syntax (with text on the `/**` line and weird indent)
- Extra spaces inside parens and after +=
- No space after comma