minor changes for stability, added link script