added isFriend function