better.java

a better solution