Added code for filtering out non-internal reads (not tested)