It would be good if you would say something about how you solved the problem - even a general approach would be useful for others.