implemented the ad-hoc add element