debugged functions for h0 and h1, hole and highest cell