Append and Prepend functions wrong way around