added ability to compute least square of function as well as datasets. changed input structure to user input for data/functions