protocol lib almost finished.