Added depth control

Depth control added by Adam Augustniak