added parameter for balance of opacity based on segment length