completed protocol layer and integrated it with demo