Added Log Function  And Preamble