Updated with clear function