Added cleanAndBalanceFunction when using ISAT