some scripts for extracting card