Completely and utterly refactored the funtions.js file. It is now much cleaner and doesn't produce any errors, simply because only the clickable cards are bound. This means that no mistakes can be made unless the user tries to cheat in the console. And that of course is handled in the backend.