Added support for many-to-many relationships