Rewrote population manager functions

they work properly now!