mapping inversions and abs follows.
fixes for random array generation