Copied method from burrow.py