add documentation to cards.c
add some functions to deal with arrays of things