Counted all inversions

Learned: global keyword