Skip matrix size at start of binary files and clean up code.