added clear and update functions