Oh my, this code is shameful. Add final depth.