Add continues for speed and some bug fixes to gamma_rays()