removed last few uses of PIL (!!!)