Split rogue-array correction functions into three seperate functions and cleaned up unnecessary extra lines