it had messed up his common sense , his ability to stay on track , and his emotional control , but it had left him with this uncanny ability to memorize useless numbers and do complex computations in his head .