virtual memory function