Modified Logic.java