add depth test to allow for refactoring