added card directive
added functionality for counting