Should have iterated over rows instead of columns