added variable to sql in getSlope