add greed calculating and render, but not perfect at all