add append function, and tests