Improved lcd.c