Added add function and tests