added and linked initial and final nodes