Remove generic parse code to a separate file so it can be used for config file parsing later
Config file
Pass around tolerance value instead of using the file-wide variable