Finished up hw5 and tested with automated testing based on randomized
cases.