minor changes to use MAXCARD instead of literal.