Cleaned up raw output, added rank counts to output