Restrict input size using fscanf when reading xbm data
Remove uneeded variables and functions