added a lot of comments for digenv.c and added error handling for dup2