added dependence on masses