started fixing array access