changes to find middle signal segment