added plotcommunities function