Added Number class.
Extracted a method.
Removed a for loop, but added some duplication.