Implemented a more efficient heap question generator