Removed Q checking to reduce Complexity. Added variables to Vertex