started to work on protocol encoder