add commas, handle divisible by both correctly