Quick hack for depth counting