new funciton depth to calculate etch depth