Simplified Shared Memory copy code, still not entirely correct!