change the main function, created the insert function and the test for it