now calculating e and h at very layer