finding maximum element from array