reworked visitor, added simple cpp test