working on isolation of images and optmization (buggy)