Updated version to manage bipartite layout (future feature)