Moved to link flag, moved some lines