fix issue where flip count increases when deck is empty
implemented initial matching functionality