Added a function removePlateau. Modified the putLabelOnImg part a bit.