hows the credits calculated?