Removed totalAmount Temp variable