Made improvements in the logic of the feeder code