rewrote deck function

Add an and statement.