Added depth parameter.