added argument to main
added missing argv to main functions
adde multiline logging
fixed unit tests