finished to implement the class