removed check for NULL edge pointer when removing element from priority queue. The element is now removed earlier instead