Save state implemented

stills runs stupid fast sometimes, saving makes it repeat last keypress.