Multiple threads working
changed syscall interface to make freeing easier