Another try on clear function