a version of registerWay passing some decent tests