adding minor code improvement from Lecture 4 (checking the object of type id if it is of class PlayingCard and then typecasting it to let the compiler know what class it is so it can help us)