implemented add functionality and tests