implementation of addCredits()