Inversion of difference sign

changed less than to grater than
also other small refactors