finally got mmap working and other stuff