Implemented a variable Lastal threshold filter depending on input sequence length