Implementation of visitor

implementation of visitor