Added some functions to manipulate cards