add run function, init logging and config parse