modification of get_mac, valgrind checks, formatting, etc.