Added maxArrayElement method