added mmap implementation