Replaced dual-inc for-loop with 2-conditions while