added scard and zcard functions