Thank you so much for this solution! This works for my use case better then the dot product and seems to be cleaner.