Clean up warnings

Use not operator to reverse indicies (instead of writing as a subtraction).