start fixing credit logic