modified referenceCredit; int -> double