added card database and some debugging code for testing