Update Problem007.java

minor code improvements