Forgot to store sorted array. Corrected.