Agrees with Javascript using multiple iterations. Worth a mini-version