cleaned up quiz result function