it's currently O(N^2), should be O(N)
it's currently O(N^2), should be O(N)