Short exercise for CS50 Java