added func referenced2d, changed trend -> polyfit, changed var names