implemented the most part of protocol commands