Working on median cut algorithm.