Card comaprion rule added, code refacotred