Javascript Peal Proving program