Detecting communities in social networks