Modified stlm() so that it takes a ts object rather than an stl object