added loops for taking the median across transcripts for a particular gene