Finish writing:) except mass function part:p