Calculating slope from tables