Added better printing and error calculation
Split regression into separate function and introduced a script for running loops