refactoring card draw and undraw with a more simple algorithm