completed prepend function