bug in winkler's function fixed