changed the constructor of MethodVertex class