Nice work. This can also be accomplished with Rails `average` instance method.