Finally gives the correct result.