added ghosting for each layer