added comments; added code to actually send data