finished linkages and several other bug fixes