primitive recroding and playback implementation
naive implementation of recording