made card moving function more readable (I hope)