bugfix : check file size before running. If too small, program will crash with arithmetic error.