Implemented very basic maxChoices in Javascript