layer_f function

Create a new layering function.