Merge math classes