added ability to take a negative number of elements from arrays