Added test case and fixed code to work for 2,000,000