added Node and Edge classes