writing Deck implementation