improved clear background method