Implemented add function

Not sure if it would work though.