implemented add functionality