added print and insert functions