factor out the tuples before computing slopes