separated the restoration of a single byte into its own method, and wrote some more tests