modified main.cpp for netsend version