writing unit tests for small fns. tried some stuff to improve appendRemove as well but no luck so far