implement quiz function