added subtraction and division to djikstra algorithm