legs: improve companion tracking

This closes #12.

Signed-off-by: diditclear <didyourupgradeclear@gmail.com>