modified the order of checks in maxIS() module