mass surplus function added