Better to loop over parameters than have a bunch of code duplicated.
Break out error handling into a separate function.
Move card scoring into a separate function.