solved prob 41 js