finished graphing function