added print statements, removed htons()