Coded the add method properly