Implemented Problem #5

Implemented Problem #5