classic graphic algorithm implemented in renderMonkey