Change context.surface to context.top and make depth relative to top.