Updated the old inpainting with the new functionality