implemented clear() and is_empty()