added to countSeqPortion a position parameter as well