implements add method.