Modified places of function

Modified name of logging
and the main function contains only one function