Added a global Id for cards. Edited code to changes.