factor out common set
added with maximum
added maximum guard
added more complex deck test