Added functions for raw protocol implementation