Added input, save states, cleaned up some stuff