wrote mmap and munmap function