commented the functions in cards.c so that it is clear what each function does