fixed minor error: added slope computation