algo with several joints