updates to slope finding formula