Improving quiz logic