Add method to return middle element of an array