Working. Pre-refactor for 1d array