Started copying over credit functions