Building a basic ranking app using mergsorts and inversions