Code for Organisational Chart Traversal