Update to previous file. Includes fixes to all functions, results are still the same