fixed the messy lowess and ls functions