Extra spaces removed.
amounts changed from a private inner class to a simpler HashMap that works better. Checked methods against contract.