Added new mask
changed constant
Corrected middle gradient calculation, added progress feature