work-in-progress new layer calculation