some tweaks to ts analysis; not sure the ts frequency code itself is good yet.