Added visitWithResult, added import code