calculating slope vertices right way