added modified mean cut algorithm