no luck trying to rewrite integral image