baby constipation

Alena

my 1 month old has been dealing with constipation since she was about 6 days old. at first it was no poop at all unless I help her with a q tip, now for almost 2 weeks she's been pooping hard balls that ripped her anus tissue a little. she has been fussing and occasionally crying trying to pass them, I'm really concerned. when she was completely constipated her pedi recommended Karo syrup but it didn't help. I tried it twice. I'm kind of at a loss. she's formula fed, I recently switched formulas and still not helping I guess. yesterday she did pass a nice soft stool but after that one time it was back to hard balls.