added depth variable