Works with double arrays