code cleanup, fixing file format and correcting the credit_amount value