Implement calculation of layer values