change the return type of the add method to void