implements #349