fixed clear method and added toString method