fix calculation of Lloyd's average to work with data loaded from json