turn functions ids into links, add conditions