Removed use of BigDecimal in trainSync(); replaced with int. Added
JavaDoc and comments.