implemented credits logic