how credits work