First-principle study of nitrogen incorporation in amorphous carbon