Code for card class, has error in it