The primary difference between this and your previous Poisson routine is that are going to be integrating outward from r=0 so that k2>k1. Thus, be sure to define h and dk appropriately and to make sure that your loop functions in increasing order.