working verion with one packet