added function to compare two points for slope