Surface wave analysis in laterally varying layered structures