added excerise 5. solution