Revised Logic.java