Writing equations from a graph