sublayer calculation