Addresses #130 and relaxes the dimensions check of the input arrays to allow dimensions in a different order.
FYI @nperez