initial implementation of mmap and random