Impurity states in doped fullerenes: C59B and C59N