Implemented Problem 8