added code for smartbutton, waldo