Finalized logic to clear cards after every 3rd click