fixed bug in department printing
changed find way algorithm