tweaking sigma implementation