Updated Clear Function