I changed the add() method to an iterative version.