Add first and last method for array