JavaScript code for PE problem 189 added.