improved the noise level detection algorithm and more layout changes