Batarray product

The code is from Simon Cruanes