improved trim_reads stand alone function