added return value to the add method