Reworked the problem

Wrote functioning add method.