implemented log and fixed main structure
modified makefile