fixed K calculation

sign error in K calculation.  added more layers.