Changed the type from int to long. Overshot the int limit.
Added tests.