adding debug printfs
cleaning up the code
example fseek()