fix wrong variable name
better comments
fix not proper final_state
remove unreliable method to detect packet from self