Lab04 work

Add cycle check and path pruning code