M and X-class flares