important bug fix; arrays with more than two elements are now handled correctly