Main function and log

Main loop for processes is practically done!
Added log file which outputs to bin/