Create working mass extraction function