Fixing Java Code