rewrote most linker code, fixed freelist