added problem 5. It has been written in javascript