modified question generator code