Add smoothness algorithm