implemented staggered grid in several functions