First draft of grid controller. Will be extended in a later phase.