Slightly faster singleRectangleValue method.
Fixing a completely wrong calculation of the sum of a square.