Refactored code and fixed a bug\n\nMoved the function to a folder so that tests will fit;\nRemoved output from the function file;\nFixed a bug - now depth can also be negative.