creat, free and print functionality (not added to main)