Refactored add method

Refactored add method