added new index() method
added clear() method