moved countSupervisors to a new function

refactored some other things