How I'm powering off a microtivity LCD

Sounds boring I know, but in case anyone else needs to completely shut off their microtivity LCD, I found a simple solution. I've been tripping all the grounds to my LCD with an IRFIZ24N MOSFET triggered by pin 1 of the Arduino. Unfortunately the display still has a little back light even with the ground gone. The digital pins were keeping it lit up.

I've found that by setting the pinmode of all the digital pins tied to the LCD as inputs after killing the ground it completely shuts down the LCD. To start it back up I redefine all the pinmodes as output then call lcd.begin() again. Here are the subroutines I'm using to do it. My LCD is wired to pins 2-7.

void lcdon()
{
  digitalWrite(lcdpower,HIGH);
  int i = 7;
  while (i>1)
  {
    pinMode(i, OUTPUT);
    i--;
  }
  lcd.begin(16, 2);
}

void lcdoff()
{
  digitalWrite(lcdpower,LOW);
  int i = 7;
  while (i>1)
  {
    pinMode(i, INPUT);
    i--;
  }
}

I hope this helps someone else out.