adding basic functionality of protocol
fixing handling of len(run) > 255