final code with minor change to specify which processor writes