Added variable segment lengths