Working version of what will become NewESAT.java.