incorporated smearing from Albert Deuzeman's smearing branch, not working at the moment.