C++ version modified to accept STAR alignments