refactoring of an older project that simulates four- and five-bar linkages with full rotary input