everything works with no memory leaks exept for 1,3,4. 1 seems like it should be correct while 3 and 4 have an extra 0 at the beginining of the output