added all psuedocode to companyhierarchy so hopefully it'll be understand and break down