specify contract for line
naively implement line