Code developed to two thirds of assignment spec, implementing helper class