let
swap array i j =
let
temp = array.(i)
in
array.(i) <- array.(j);
array.(j) <- temp