new code with examples for the mass.