trying a simple painter rendering algorithm