Working on smoothing, added function. Needs work