Created a deck class and fixed issues that arose due to it