Finished insert and added some basic ouptut functions