RPC code which has been modified to be suitable for debugging