graphing functionality but the y coordinate sometimes extends past canvas