some card picker initial code, refactored js