HW4 Code with shell scripts finished