Beyond MAGIC: Matching Collaborative Gestures using an optimization-based Approach