Made lineMatching into an extractLines function and edited the range threshold in removeBackground