attempt at delta encoding in C