elegantly solves the challenge problem for A5, updates Picture.java