Speeded up sigma calculation