replaced many .toFixed with .toPrecision, which works better in most cases. Other minor cleanup and final runs of function testing