added smoothing, works real nice (for #25)