Weird smoothing mixup in code