Updated with new support for broadcasting (and unwrapping)