JavaScript code for PE problem 178 added.