add test for append algorithm