Better variable names and inversion check added