linking works correctly