refactored loop to split highs and lows into respective lists