Some modifications added to amounts javascript