Schlemiel the painter's Algorithm