changed foreach -> forEach, fixed bug in double black case, 1.0.0