Extended functionality to handle large amounts like millions.
Added tests