Added to fork, perror, and wait for hw 4, will do at least one more later and fix any writing errors