Added layer calculation