added ability to reverse arrays