Help! Treating a lingering hamstring injury

Options
I injured my upper left hamstring almost 3 months ago playing baseball. I am not sure whether I pulled or strained the muscle as the only treatment I really gave was ice and rest. There was a little swelling but no noticeable bruising. Since that date, I waited about 2 weeks (ice and rest) before really testing it again. I started to go to the gym and could do every exercise I did before but a few times got on a treadmill and really pushed myself. When I did this, I felt minor cramping even after a month or two. When I do go for morning runs, I always feel the hamstring when I get to a speed that is difficult. I am worried that participating in a basketball game next week may re-injure the hamstring. I tend to feel it also when I have to make sudden movements with my legs (i.e. stopping, starting, twisting). does anyone have any advice on how I could treat this to make it go away?!

Thank you!!!!