Working
TODO: replace fseek with fgetpos