completed intrinsic image algorithm