Changed flow control to use popdata instead