Simple "Magic Square" solver in Java