working problem from coderbyte.com, the first few problems in JS