Fixing problem 51 to make it faster. up to 186ms