Removed the old function and fixed a mistake from the function checkCard