Pretty long code for me at this hour, but you should add lcd.setCursor(x,y) in loop before everything. Otherwise it prints to undefined locations, left by previous printing, so who knows where it prints. Do (0,1), so you always know the first few lcd.print will print from (0,1).