FIX: Entirely different algorithm for hisotry of layer adding.